#1-用大写字母打印名字
def AA():
    rowNum=6
    ANum=11
    for i in range(rowNum):
        for j in range(ANum):
            if i==j:
                print(' '*(rowNum-i),(2*j+1)*'A')
AA()

def A():
    rowNum=6
    space=' '
    end=''
    for i in range(rowNum):
        curSpaceNum=rowNum-i
        if i==0:
            print(space*curSpaceNum,'A',end)
            continue
        if i==1:
            print(space*curSpaceNum,'A','A',end)
            continue
        if i==3:
            print(space*curSpaceNum,(2*i+1)*'A',end)
            continue
        print(space*curSpaceNum,'A',space*(2*i-3),'A',end)

A()
print()

def YourName():
    print("  CCCC  ",'      A      ',' RRRRR   ',' TTTTTTT ',' EEEEEE ',' RRRRR  ')
    print(" C    C ",'     A A     ',' R    R  ','    T    ',' E      ',' R    R ')
    print("C       ",'    A   A    ',' R    R  ','    T    ',' EEEE   ',' R    R ')
    print("C       ",'   AAAAAAA   ',' RRRRR   ','    T    ',' E      ',' RRRRR  ')
    print(" C    C ",'  A       A  ',' R    R  ','    T    ',' E      ',' R    R ')
    print("  CCCC  ",' A         A ',' R      R','    T    ',' EEEEEE ',' R     R')
    print()

YourName()

#2-函数可以打印全世界任何人名、地址、街道、城市、州或省、邮政编码和国家

def PrintAddressInfo(addressInfo=[]):
    if addressInfo!='':
        for info in addressInfo:
            print(info)
    print()
addressInfo=['张三','测试地址','测试街道','测试城市','测试室州','612000','中国']
PrintAddressInfo(addressInfo)    

#3-使用全局变量
print("变量作用域2")
def calculateTax(price,tax_rate):
    taxTotal=price+(price*tax_rate)
    #强制在函数内使用全局版的变量[my_testPrice2]
    global my_testPrice2
    my_testPrice2=10000
    print("my_testPrice(函数内)=",my_testPrice2)
    return taxTotal

my_testPrice2=float(input("请输入价格："))
totalPrice=calculateTax(my_testPrice2,0.06)
print("my_testPrice(函数外)=",my_testPrice2," Total price= ",totalPrice)
        
#4-计算零钱的总面值

def GetTotalMoney():
    isLoop=True
    while(isLoop):
        fen = input("请输入有几分钱：")
        if fen!='':
            realFen=int(fen)
        else:
            realFen=0
            
        jiao = input("请输入有几角钱：")
        if jiao!='':
            realJiao=int(jiao)
        else:
            realJiao=0

        yuan = input("请输入有几元钱：")
        if yuan!='':
            realYuan=int(yuan)
        else:
            realYuan=0
        
        total_Yuan=realYuan+realJiao/10+realFen/100
        print("当前共有【%f】元钱"%total_Yuan)
        result=input("是否还要继续?【Y】表示继续，其他按键则退出")
        if result!='':
            isLoop=True
        if result=='Y' or result=='y':
            isLoop=False
            break
    return total_Yuan

GetTotalMoney()



        


